import request from '@/utils/request'

export function selectAll() {
  return request({
    url: '/bearing/componentdata/selectAll',
    method: 'get'
  })
}
// 查询数据入库列表
export function listComponentdata(query) {
  return request({
    url: '/bearing/componentdata/list',
    method: 'get',
    params: query
  })
}

// 查询数据入库详细
export function getComponentdata(id) {
  return request({
    url: '/bearing/componentdata/' + id,
    method: 'get'
  })
}

// 新增数据入库
export function addComponentdata(data) {
  return request({
    url: '/bearing/componentdata',
    method: 'post',
    data: data
  })
}

// 修改数据入库
export function updateComponentdata(data) {
  return request({
    url: '/bearing/componentdata',
    method: 'put',
    data: data
  })
}

// 删除数据入库
export function delComponentdata(id) {
  return request({
    url: '/bearing/componentdata/' + id,
    method: 'delete'
  })
}
export function listComponentTypes() {
  return request({
    url: '/bearing/component_types/list',
    method: 'get'
  });
}
// 在原有的 API 方法基础上添加
export function listComponentLabels() {
  return request({
    url: '/bearing/component_labels/list',
    method: 'get'
  });
}
// 在原有的 API 方法基础上添加
export function listComponentConditions() {
  return request({
    url: '/bearing/component_conditions/list',
    method: 'get'
  });
}
// 在原有的 API 方法基础上添加
export function uploadFile(data) {
  return request({
    url: '/bearing/componentdata/upload',
    method: 'post',
    data,
    headers: { 'Content-Type': 'multipart/form-data' }
  });
}
// 保存特性文件路径
export function saveCharacteristicFilePath(data) {
  return request({
    url: '/bearing/save-characteristic-file-path',
    method: 'post',
    data: data
  });
}
